package com.winning.sjzc.login.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.winning.sjzc.login.dao.SysCzryJsMapper;
import com.winning.sjzc.login.entity.SysCzryJsEntity;
import com.winning.sjzc.login.service.SysCzryJsService;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * description:操作人员角色
 *
 * @author yanxf@winning.com.cn
 * @date 2019/08/14 9:06
 */
@Slf4j
@Service
public class SysCzryJsServiceImpl implements SysCzryJsService {

  @Autowired
  private SysCzryJsMapper sysCzryJsMapper;

  @Override
  public List<String> getJsbmList(String zclsh) {
    try {
      List<SysCzryJsEntity> list = sysCzryJsMapper
          .selectList(new LambdaQueryWrapper<SysCzryJsEntity>().eq(SysCzryJsEntity::getZclsh, zclsh));
      return list.stream().map(x -> x.getJsdm()).collect(Collectors.toList());
    } catch (Exception e) {
      log.error("getJsbmList", e);
      return new ArrayList<>();
    }
  }
}
